﻿using System;
using System.Reflection;

namespace Fabrication.ValueProviders
{
    internal sealed class StructProvider : IValueProvider
    {
        private Type itemType;

        public void Initialize(PropertyInfo property)
        {
            itemType = property.PropertyType;
        }

        object IValueProvider.GetValue(object item)
        {
            return Activator.CreateInstance(itemType);
        }
    }
}